package ptij.vocoder.baseModel.lp_analysis;

import ptolemy.actor.*;
import ptolemy.kernel.*;
import ptolemy.kernel.util.*;
import ptolemy.data.ObjectToken;
import ptolemy.data.type.*;

import ptij.vocoder.baseModel.*;

//////////////////////////////////////////////////////////////////////////
//// Int_lpc2
/**

@author Ivan Jeukens
@version v 0.1 07/08/2003
*/
public class Int_lpc2 extends TypedAtomicActor {

    public Int_lpc2(CompositeEntity container, String name) throws
            IllegalActionException, NameDuplicationException {
        super(container, name);

        lsp_old = new TypedIOPort(this, "lsp_old", true, false);
        lsp_old.setTypeEquals(BaseType.OBJECT);
        
        lsp_mid = new TypedIOPort(this, "lsp_mid", true, false);
        lsp_mid.setTypeEquals(BaseType.OBJECT);
        
        lsp_new = new TypedIOPort(this, "lsp_new", true, false);
        lsp_new.setTypeEquals(BaseType.OBJECT);

        A = new TypedIOPort(this, "A", false, true);
        A.setTypeEquals(BaseType.OBJECT);
    }

    ///////////////////////////////////////////////////////////////////
    ////                     ports and parameters                  ////

    // Input ports
    public TypedIOPort lsp_old;
    public TypedIOPort lsp_mid;
    public TypedIOPort lsp_new;

    // Output Ports
    public TypedIOPort A;

    ///////////////////////////////////////////////////////////////////
    ////                         public methods                    ////

    public void fire() throws IllegalActionException {
        ObjectToken obj = (ObjectToken) lsp_old.get(0);
        Short [] arg1 = (Short []) obj.getValue();

        obj = (ObjectToken) lsp_mid.get(0);
        Short [] arg2 = (Short []) obj.getValue();

        obj = (ObjectToken) lsp_new.get(0);
        Short [] arg3 = (Short []) obj.getValue();
        
        Short [] arg4 = new Short[Cnst.MP1*4];

        _int_lpc2(arg1, arg2, arg3, arg4);

        obj = new ObjectToken(arg4);
        A.broadcast(obj);
    }

    ///////////////////////////////////////////////////////////////////
    ////                         private methods                   ////

    private void _int_lpc2(Short [] lsp_old, Short [] lsp_mid, 
            Short [] lsp_new, Short [] A) {
        
        
        
    }

    ///////////////////////////////////////////////////////////////////
    ////                         private variables                 ////

}
